import * as articlesApi from '../../api/hmmm/articles'
const articlesInfo = {
  namespaced: true,
  state: {
    articlesList: {},
    articlesDetail: {}


  },
  mutations: {
    SET_ARTICLES_LIST: (state, newValue) => {
      state.articlesList = newValue
    },
    SET_ARTICLES_DETAIL: (state, newValue) => {
      state.articlesDetail = newValue
    },
  },
  actions: {
    async updateArticlesList (context, data) {
      const res = await articlesApi.getArticlesList(data)
      context.commit('SET_ARTICLES_LIST', res)
    },
    async updateArticlesDetail (context, data) {
      const res = await articlesApi.articlesDetail(data)
      context.commit('SET_ARTICLES_DETAIL', res)
    }
  }
}

export default articlesInfo
